import React from 'react'
import {Button} from "antd"
import axios from "axios"
type Props = {}

const Payment_order = (props: Props) => {
  const pay_order = () =>{
    axios.get("/api/pay",{
      params:{code:Math.floor(Math.random()*10000+1),
        price:Math.floor(Math.random()*10000+1)}
      }).then(res=>{
      window.location.href = res.data.result
    })
  }
  return (
    <div>
      <Button onClick={pay_order}>支付</Button>
      
    </div>
  )
}

export default Payment_order